<template>
  <div>
    <!-- 面包屑 -->
    <cru msg1="权限" msg2="权限"></cru>
    <!-- 表单 -->
    <el-card class="box-card">
      <el-table :data="tableData" style="width: 100%" :stripe="true" :border="true">
        <el-table-column type="index" label="序号" width="160"></el-table-column>
        <el-table-column prop="authName" label="权限名称" width="260"></el-table-column>
        <el-table-column prop="path" label="路径"></el-table-column>
        <el-table-column prop="level" label="等级" width="160">
          <template slot-scope="info">
            <el-tag v-if="info.row.level==='0'">一级</el-tag>
            <el-tag v-else-if="info.row.level==='1'" type="success">二级</el-tag>
            <el-tag v-else type="warning">三级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  created() {
    this.getList()
  },
  data() {
    return {
      tableData: []
    }
  },
  methods: {
    async getList() {
      const { data: dt } = await this.$http.get('rights/list')
      console.log(dt)
      this.tableData = dt.data
    }
  }
}
</script>

<style lang="less" scoped>
</style>
